package cn.remex.core.log;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import cn.remex.core.CoreSvo;

/**
 * Disc:
 * Created by xinxinran on 2017/2/12.
 */
public class ClientIPConverter extends ClassicConverter {

    @Override
    public String convert(ILoggingEvent iLoggingEvent) {
        Object ip = CoreSvo.valLocal(CoreSvo.HTTP_CLIENT_IP);

        return ip == null ? "LocalServer" : String.valueOf(ip);
    }
}
